<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/tr/html4/loose.dtd">
<html> 
<head>
<title>Building the Shared Source CLI and C# Source Tree</title>
<link rel="stylesheet" type="text/css" href="../rotor.css" />
</head>
<body>		

<h1>Building the Shared Source CLI 2.0 and C# 2.0 Source Tree</h1>

 
<h3>Contents</h3>

 
<ul>
  <li><a href="#Quickstart">QuickStart</a></li>
  <li><a href="#BuildOptionChanges">Build option changes in SSCLI 2.0</a></li>
  <li><a href="#OverviewoftheSharedSourceCLIBuildProcess">Overview of the Shared 
  Source CLI 2.0 Build Process</a></li>
  <li><a href="#SharedSourceCLIBuildDetailsandScenarios">Shared Source CLI 2.0 Build 
  Details and Scenarios</a><ul>
  <li><a href="#PrimaryBootstrap">Primary Bootstrap</a></li>
  <li><a href="#SecondaryBootstrap">Secondary Bootstrap</a></li>
  <li><a href="#SharedSourceCLICoreCLI">Shared Source CLI Core CLI, C# Compiler, 
  Base Class Libraries, and Supporting Tools</a></li>
  <li><a href="#FXClassLibraries">FX Class Libraries</a></li>
  <li><a href="#ManagedClassLibraries">Managed Class Libraries</a></li>
  <li><a href="#ManagedCompilers">Managed Compilers</a></li>
</ul>

 
  </li>
  <li><a href="#UsingBuildLogstoTroubleshootBuildProblems">Using Build Logs to 
  Troubleshoot Build Problems</a></li>
  <li><a href="#NotesHintsandTips">Notes, Hints, and Tips</a><ul>
  <li><a href="#AutogeneratedFiles">Autogenerated Files</a></li>
  <li><a href="#FasterRebuilds">Faster Rebuilds</a></li>
  <li><a href="#FilePreprocessing">File Preprocessing</a></li>
</ul>

 
  </li>
</ul>

 
<h2><a name="Quickstart"></a>QuickStart</h2>

 
<p>The following steps represent the quickest and most reliable way to build the 
Microsoft&reg; Shared 
Source CLI 2.0 (SSCLI) implementation:</p>

 
<p>On the Microsoft&reg; Windows&reg; operating system:</p>
<ol>
  <li>Change directories into the root of the SSCLI source tree.</li>
  <li>Run the <a href="env.html">env.bat</a> batch file.</li>
  <li>Run the <a href="buildall.html">buildall.cmd</a> batch file.</li>
</ol>

<h2><a name="BuildOptionChanges"></a>Build option changes in SSCLI 2.0</h2>

 
<p>
    There are a few major changes to the buildall arguments to specify a SSCLI build
    flavor. The table below specifies the old SSCLI version 1.0 options and what they
    correspond to in SSCLI version 2.0.</p> 
    <p>
        <table border="1" width="90%">
            <tr valign="top">
                <th width="28%">
                    SSCLI 1.0 Build Option</th>
                <th width="28%">
                    Corresponding SSCLI 2.0 Build Option</th>
            </tr>
            <tr valign="top">
                <td width="28%" rowspan="1">
                    checked</td>
                <td width="28%" rowspan="1">
                    debug</td>
            </tr>
            <tr valign="top">
                <td width="28%" rowspan="1">
                    fastchecked</td>
                <td width="28%" rowspan="1">
                    checked</td>
            </tr>
            <tr valign="top">
                <td rowspan="1" width="28%">
                    free</td>
                <td rowspan="1" width="28%">
                    free</td>
            </tr>
        </table>
    </p>
 
<h2><a name="OverviewoftheSharedSourceCLIBuildProcess"></a>Overview of the 
Shared Source CLI&nbsp; 2.0 (SSCLI) Build Process</h2>

 
<p>The SSCLI build process is designed in a modular manner.&nbsp; You can build 
all of the SSCLI or only parts of the SSCLI; however, there are strict 
sequential dependencies between elements of the source tree.&nbsp; In all cases, 
the build process requires that your environment variables be set correctly 
before building. For more information on correctly configuring your environment 
prior to building, see <a href="env.html">env.html</a>.</p>

 
<p>Note that the path to and directory name of the location where the SSCLI is installed 
cannot contain spaces.&nbsp;Some tools that the build process depends on do not 
work correctly on paths containing spaces.</p>

 
<p>Elements of the  SSCLI implementation depend on other 
elements in a strict sequential order.&nbsp;The best way to start modifying 
elements of the source tree is to build the entire tree using the buildall batch 
file or script that will build the required dependencies in the correct order and have them 
available in the path.&nbsp;After that it is possible to selectively rebuild 
specific elements of the source tree.</p>
<p>The SSCLI 2.0 source tree has the following  major elements:</p>
<ol>
  <li>Primary bootstrap elements: the  PAL and unmanaged  bootstrap build tools.</li>
  <li>Secondary bootstrap elements: the remaining tools and support infrastructure.</li>
  <li>The core CLI implementation, base class libraries, the C# compiler, and 
  supporting tools.</li>
  <li>The FX class libraries and supporting tools.</li>
  <li>Other assemblies.</li>
  <li>Managed compilers.</li>
</ol>
<p>In general each major element  depends on the preceding element having 
been built and the output of the build in the path.&nbsp;There are more 
complicated dependencies within each of the major elements.&nbsp; The dependency 
order of the major elements can be determined by reading buildall.bat or the 
buildall script.&nbsp;Dependency orders within  large elements such as the 
CLI, C#, and base class libraries or the FX class libraries can be 
determined by reading the order of the files in the dirs file at the 
root of the relevant source tree.&nbsp; </p>
<h2><a name="SharedSourceCLIBuildDetailsandScenarios"></a>SSCLI 2.0 Build Details and Scenarios</h2>
<p>You should always use  buildall.cmd or the buildall script to build the entire 
source tree before attempting to work with separate elements.&nbsp;The 
scenarios below describe the necessary procedures for modifying and building 
specific portions of the SSCLI source tree.</p>
<p>The SSCLI build process works off of relative path location.&nbsp;You must 
switch to the correct directory where the sources files or makefiles are and 
then execute the required command.</p>
<p>Available build options for the build utility are specified in
<a href="buildutility.html">buildutility.html</a>.&nbsp; Builds that use 
make.cmd  support only the <b>-c</b> (clean) option to indicate that existing object files 
are to be deleted.</p>
<h3><a name="PrimaryBootstrap"></a>Primary Bootstrap</h3>
<p>The primary bootstrap element of the SSCLI source tree uses makefiles during 
the initial build rather than the build utility, because this utility and the other 
supporting build tools have not been built yet.&nbsp; On Windows, the build 
process uses make.cmd batch files which then invoke the Microsoft Program 
Maintenance Utility (nmake.exe  provided in the 
path by Microsoft&reg; Visual Studio&reg; 2005) to process
    the required makefiles.&nbsp;</p>
    <p>
        The primary build bootstrap subelements are:</p>

 
<ul>
  <li>The Platform Adaptation Layer (PAL).&nbsp;The PAL is used by build and 
  other tools so it must be built first.</li>
  <li>The nmake makefile tool (the version built during the build process is only used on 
  UNIX system-based platforms).</li>
  <li>The Build Output Manager tool.</li>
  <li>The build utility.</li>
</ul>

 
<p>The  PAL must be built before any other  builds are attempted.&nbsp; </p>

 
<table border="1" width="90%">

<tr valign="top">
<th width="20%">Build scenario</th>
<th width="18%">Source location</th>
<th width="26%">Build commands</th>
<th width="68%">Build output</th>
</tr>

<tr valign="top">
<td width="20%" rowspan="1">Build the Platform Adaptation 
Layer (PAL).</td>
<td width="18%">%ROTOR_DIR%\pal\<b>win32</b></td>
<td width="26%">cd %ROTOR_DIR%<i>\</i>pal\win32<br>
build [options]<p>(If build.exe is not built yet, you can use make.cmd)</td>
<td width="68%">
    %_NTTREE%\rotor_pal.dll</td>
</tr>

<tr valign="top">
<td width="20%" rowspan="1">Build the VBuild Output Manager tool.</td>
<td width="18%" rowspan="1" >%ROTOR_DIR%\tools\binplace</td>
<td width="26%">cd %ROTOR_DIR%<i>\</i>tools\nmake<br>
make [options]<p>The &quot;make&quot; command executes make.cmd.</td>
<td width="68%">
    %_NTTREE%\binplace.exe</td>
</tr>

<tr valign="top">
<td width="20%" rowspan="1">Build the build utility.</td>
<td width="18%" rowspan="1" >%ROTOR_DIR%\tools\build</td>
<td width="26%">cd %ROTOR_DIR%<i>\</i>tools\build<br>
make [options]<p>The &quot;make&quot; command executes make.cmd.</td>
<td width="68%">
    %_NTTREE%\build.exe</td>
</tr>

</table>

 
<h3><a name="SecondaryBootstrap"></a>Secondary Bootstrap</h3>
<p>In the secondary bootstrap portion of the source tree it is assumed that the build tools are sufficiently complete to 
enable using them to build.&nbsp;This means  that the build directives are specified in a sources file 
(see <a href="buildutility.html">buildutility.html</a>) and not in a makefile or 
make.cmd file.</p>
<p>Subelements of the primary bootstrap are:</p>
<ul>
  <li>The resource compiler.</li>
  <li>The PAL runtime (PAL RT).&nbsp;The PAL RT supports some higher-level 
  functionality shared across platforms by the SSCLI implementation and 
  supporting tools.</li>
</ul>

 
<p>For the following tools and the PAL RT, all the primary bootstrap utilities 
and the PAL must be built, functional, and in the path.</p>

 
<table border="1" width="90%">

<tr valign="top">
<th width="28%">Build scenario</th>
<th width="28%">Source location</th>
<th width="47%">Build commands</th>
<th width="52%">Build output</th>
</tr>

<tr valign="top">
<td width="28%" rowspan="1">Build the resource compiler tool.</td>
<td width="28%" rowspan="1">%ROTOR_DIR%\tools\<br>
resourcecompiler</td>
<td width="47%" rowspan="1">cd %ROTOR_DIR%<i>\</i>tools\resourcecompiler<br>
build [options]</td>
<td width="52%">
    %_NTTREE%\<br>
resourcecompiler.exe</td>
</tr>

<tr valign="top">
<td width="28%" rowspan="1">Build the PAL RT common shared 
utility infrastructure.</td>
<td width="28%" rowspan="1">%ROTOR_DIR%\palrt\src</td>
<td width="47%" rowspan="1">cd %ROTOR_DIR%<i>\</i>palrt\src<br>
build [options]</td>
<td width="52%">
    %_NTTREE%\rotor_palrt.dll</td>
</tr>

</table>

 
<br/>
<hr>

 
<p align="left">For all the following build scenarios the build commands are:<blockquote>

<pre>cd &lt;source_location&gt;
<br>build [options]</pre>
</blockquote>
<p>For more details on the build 
utility options see
<a href="buildutility.html">buildutility.html</a>.&nbsp; The most common options are -c for clean build and -z to 
skip calculating dependencies.<br></p>

 
<h3><a name="SharedSourceCLICoreCLI"></a>SSCLI Core, C# Compiler, Base Class Libraries, and Supporting Tools</h3>
<p>After the primary and secondary bootstrap elements are built, it is possible 
to proceed with building the core SSCLI 
implementation, C# compiler, and base class libraries.&nbsp; This section of the 
build is very complex due to  interdependencies between the core CLI 
code, C#, and the base class libraries.&nbsp; When making changes across 
subelements of this tree, you should rebuild the entire tree starting at 
%ROTOR_DIR%\clr\src.&nbsp; </p>
<p>Some critical 
subelements of this tree are:</p>
<ul>
  <li>utilcode<ul>
    <li>Common shared C++ utility code.</li>
  </ul>
  </li>
  <li>vm<ul>
    <li>A large portion of the CLI implementation.</li>
  </ul>
  </li>
  <li>fusion<ul>
    <li>Assembly searching and binding.</li>
  </ul>
  </li>
  <li>dlls<ul>
    <li>Unmanaged CLI support libraries.</li>
  </ul>
  </li>
  <li>ilasm<ul>
    <li>The ilasm assembler tool.</li>
  </ul>
  </li>
  <li>ildasm<ul>
    <li>The ildasm disassembly tool.</li>
  </ul>
  </li>
  <li>fjit<ul>
    <li>The just-in-time (JIT) compiler implementation.</li>
  </ul>
  </li>
  <li>tools<ul>
    <li>Supporting tools and utilities.</li>
  </ul>
  </li>
  <li>bcl<ul>
    <li>The base class libraries.&nbsp; These are the most fundamental managed 
    code assemblies.
        . </li>
  </ul>
  </li>
  <li>toolbox<ul>
    <li>Some additional managed tools. </li>
  </ul>
</li>
</ul>

 
<table border="1" width="90%">

<tr valign="top" width=100%>
<th width="25%" height="16">Build scenario</th>
<th width="25%" height="16">Source location</th>
<th width="25%" height="16">Build output</th>
</tr>

<tr valign="top">
<td width="25%" height="70">Modify any CLI, C#, or&nbsp; base class library file 
and rebuild the entire tree.</td>
<td width="25%" height="70">%ROTOR_DIR%\clr\src</td>
<td width="25%" height="70">Most of the contents of the %_NTTREE% directory and subdirectories are produced from this build 
command.</td>
</tr>

<tr valign="top">
<td width="25%" height="383">Build the main CLI execution engine directory: VM<p>
The .lib file produced from this step is used to link the 
sscoree.dll/libsscoree.so/libsscoree.dylib library.&nbsp; After successfully
building the execution engine, you must relink the resulting file 
(cee_wks.lib) into the sscoree.dll/libsscoree.so/libsscoree.dylib library in order
to incorporate your change.  Do this by building the 
mscoree directory, as detailed further down in this table.</p>
<p>
Changing .asm/.s files requires either a clean build using -c, or manual 
deletion of the .obj file from under wks/obj{d|df|}/rotor_x86/<p>
The src\vm directory contains the dirs file, and src\vm\wks directory contains the sources 
file
</td>
<td width="25%" height="383">%ROTOR_DIR%\clr\src\vm</td>
<td width="25%" height="383">
    %_NTTREE%<br />
    %ROTOR_DIR%\clr\lib\chk\rotor_x86\cee_wks.lib</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="260">Build the C# compiler and Assembly Linker.</td>
<td width="25%" rowspan="1" height="260">
    %ROTOR_DIR%\csharp</td>
<td width="25%" height="127">
    %_NTTREE%\csc.exe<p>
        %_NTTREE%\cscomp.dll</p>
<p>
    %_NTTREE%\al.exe</p>
<p>
    %_NTTREE%\alink.dll</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="133">Build the C# compiler.</td>
<td width="25%" rowspan="1" height="133">
    %ROTOR_DIR%\csharp</td>
<td width="25%" height="57">
    %_NTTREE%\csc.exe<p>
    %_NTTREE%\cscomp.dll</td>
</tr>

<tr valign="top">
<td width="25%" height="156">Build the base class libraries (BCL).<p>Note: All of the BCLs are built 
through one call to the C# compiler, passing all .cs files by way of a 
response file. There is no partial build of the BCLs.<br>
</td>
<td width="25%" height="156">%ROTOR_DIR%\clr\src\bcl</td>
<td width="25%" height="156">
    %_NTTREE%\mscorlib.dll<p>
    %_NTTREE%\*.nlp</td>
</tr>

<tr valign="top">
<td width="25%" height="220">Build core CLI dynamic libraries and .lib files. 
These can also be built individually in each subdirectory:<ul>
  <li>shim - creates shim.lib support libbrary</li>
  <li>mscorsn - strongname verification</li>
  <li>mscorpe - PE file reading and writing</li>
  <li>mscoree -&nbsp; See table item below.</li>
  <li>mscordbi and mscordbc - debugging services<br>
&nbsp;</li>
</ul>
  </td>
<td width="25%" height="220">%ROTOR_DIR%\clr\src\dlls</td>
<td width="25%" height="220">(See individual components <i>sources</i> file.)</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="144">Build the mscoree directory.&nbsp; This directory 
builds the dynamic library that is loaded first when the SSCLI CLI execution 
engine starts up.<p>This library&nbsp; is a merged combination of the 
mscoree.dll and mscorwks.dll/mscorsvr.dll in the Windows .NET Framework 
implementation.</td>
<td width="25%" rowspan="1" height="144">%ROTOR_DIR%\clr\src\dlls\mscoree</td>
<td width="25%" height="32">
    %_NTTREE%\sscoree.dll</td>
</tr>

<tr valign="top">
<td width="25%" height="105">Build the C++ common code shared between many 
components.<p>To incorporate changes to these libraries you should rebuild the 
entire tree starting at clr\src.</td>
<td width="25%" height="105">%ROTOR_DIR%\src\utilcode</td>
<td width="25%" height="105">
    %_NTTREE%<br />
    %ROTOR_DIR%\clr\lib\chk\rotor_x86\utilcode.lib<br />
    %ROTOR_DIR%\clr\lib\chk\rotor_x86\.lib</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="60">Build the just-in-time (JIT) compiler 
implementation.</td>
<td width="25%" rowspan="1" height="60">%ROTOR_DIR%\src\fjit </td>
<td width="25%" height="22">
    %_NTTREE%\mscorejt.dll</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="98">Build the assembly searching and binding 
code that implements the global assembly cache.</td>
<td width="25%" rowspan="1" height="98">%ROTOR_DIR%\src\fusion</td>
<td width="25%" height="22">
    %_NTTREE%\fusion.dll</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="98">Build the ilasm IL assembler.</td>
<td width="25%" rowspan="1" height="98">%ROTOR_DIR%\src\ilasm</td>
<td width="25%" height="22">
    %_NTTREE%\sdk\bin\ilasm.exe</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="98">Build the ildasm assembly disassembler.</td>
<td width="25%" rowspan="1" height="98">%ROTOR_DIR%\src\ildasm </td>
<td width="25%" height="22">
    %_NTTREE%\sdk\bin\ildasm.exe</td>
</tr>

<tr valign="top">
<td width="25%" rowspan="1" height="98">Build the managed debugger. Part of the debugger 
functionality is built into the 
CLI execution 
engine and part of it is built into the Runtime Debugger.</td>
<td width="25%" rowspan="1" height="98">%ROTOR_DIR%\src\debug<br>
&nbsp;</td>
<td width="25%" height="22">
    %_NTTREE%\sdk\bin\cordbg</td>
</tr>

<tr valign="top">
<td width="25%" height="89">Build the metadata reader/writer.<p>To incorporate 
changes to this library you should rebuild the entire tree starting at clr\src.</td>
<td width="25%" height="89">%ROTOR_DIR%\src\md </td>
<td width="25%" height="89">
    %_NTTREE%<br />
    %ROTOR_DIR%\clr\lib\chk\rotor_x86\ceefgen.lib</td>
</tr>

<tr valign="top">
<td width="25%" height="284">Build miscellaneous unmanaged tools.&nbsp;Each of these 
tools can be built individually as well.<ul>
  <li>clix directory- managed application launcher</li>
  <li>ildbsymbols directory - managed debugger symbol reader/writer</li>
  <li>metainfo directory - metadata viewer</li>
  <li>peverify - IL verifier</li>
  <li>internalresgen directory - internal build tool</li>
  <li>sn directory - Strong Name tool</li>
  <li>permview-&nbsp; security permissions viewer</li>
  <li>gac directory - global assembly cache management tool</li>
  <li>sos - debug support library</li>
</ul>
</td>
<td width="25%" height="284">%ROTOR_DIR%\src\tools</td>
<td width="25%" height="284">(See individual source files for tools.)</td>
</tr>

</table>

 
<h3><a name="FXClassLibraries"></a>FX Class Libraries</h3>
<p>The  FX class libraries provide basic runtime class library 
support.&nbsp; Important sub-elements include:</p>
<ul>
  <li>The <b>System</b> assembly.</li>
  <li>The <b>System.Xml </b>assembly.</li>
</ul>

 
<p>To build the FX class libraries, switch to the source location 
directory and run the build utility.</p>

 
<table border="1" width="90%">

<tr valign="top">
<th width="33%">Build scenario</th>
<th width="33%">Source location</th>
<th width="33%">Build output</th>
</tr>

<tr valign="top" width=100%>

<td width="33%">Build the System.dll and System.Xml.dll assemblies.<p>Note: There is 
a circular dependency between System.dll and System.Xml.dll assemblies. If you 
delete one of these assemblies you must build both from this location.</td>
<td width="33%">%ROTOR_DIR%\fx\src</td>
<td width="33%">
    %_NTTREE%\System.dll<br>
    %_NTTREE%\System.Xml.dll<p>These are also installed to<br>
        %_NTTREE%\assembly\GAC</p>
</td>
</tr>
<tr valign="top" width=100%>
<td width="33%">Build the System.dll assembly.</td>
<td width="33%">%ROTOR_DIR%\fx\src\sys</td>
<td width="33%">
    %_NTTREE%\System.dll</td>
</tr>

<tr>
<td width="33%">Build the System.Xml.dll assembly.</td>
<td width="33%">%ROTOR_DIR%\fx\src\xml</td>
<td width="33%">
    %_NTTREE%\System.Xml.dll</td>
</tr>

</table>

 
<h3><a name="ManagedClassLibraries"></a>Managed Class Libraries</h3>

 
<p>Additional managed class libraries:</p>
<ul>
  <li>System.Runtime.Serialization.Formatters.Soap assembly</li>
  <li>System.Runtime.Remoting assembly</li>
</ul>

 
<p>To build the managed class libraries switch to the source location 
directory and run the build utility.</p>

 
<table border="1" width="90%">

<tr valign="top">
<th width="30%">Build scenario</th>
<th width="30%">Source location</th>
<th width="30%">Build output</th>
</tr>

<tr>
<td width="30%">Build the System.Runtime.Serialization.Formatters.Soap.dll 
assembly.</td>
<td width="30%">%ROTOR_DIR%\managedlibraries\<br>
soapserializer</td>
<td width="30%">
    %_NTTREE%\<br>
System.Runtime.Serialization.Formatters.Soap.dll</td>
</tr>

<tr valign="top">
<td width="30%">Build the System.Runtime.Remoting.dll<br>
assembly.</td>
<td width="30%">%ROTOR_DIR%\managedlibraries\<br>
remoting</td>
<td width="30%">
    %_NTTREE%\<br>
System.Runtime.Remoting.dll</td>
</tr>

</table>

 
<h3><a name="ManagedCompilers"></a>Managed Compilers</h3>

 
<p>The Microsoft JScript&reg; compiler is implemented as a managed application.&nbsp; 
It also builds managed applications.</p>

 
<p>To build the managed compilers, switch to the source location directory and 
run the build utility.</p>

 
<table border="1" width="90%">

<tr valign="top" width=100%>
<th width="33%">Build scenario</th>
<th width="33%">Source location</th>
<th width="33%">Build output</th>
</tr>

<tr valign="top">
<td width="33%">Modify and rebuild the JScript managed compiler.</td>
<td width="33%">%ROTOR_DIR%\jscript</td>
<td width="33%">
    %_NTTREE%\jsc.exe<p>The files below are also installed to<br>
        %_NTTREE%\assembly\GAC</p>
<p>
    %_NTTREE%\Microsoft.Vsa.dll</p>
<p>
    %_NTTREE%\Microsoft.JScript.dll</p>
</td>
</tr>

</table>

 
<h2>
<span class="subheadingblack">
<a name="UsingBuildLogstoTroubleshootBuildProblems"></a>Using  Build 
Logs to Troubleshoot Build Problems</span></h2>
<p>
When you build the SSCLI, a large volume of information is sent to the console 
window during the build.&nbsp;Many people assume that this is important build 
log output but it is not the complete build log output and is useful mostly for the final summary 
content which 
indicates whether there were build errors or warnings.&nbsp;The build utility emits 
its useful information to build log files.&nbsp; </p>
<p>
<span class="subheadingblack">Build log file names are annotated with the type 
of build and have an extension that indicates whether they contain error, 
warning, or general log information. Log file names are annotated to 
prevent build logs of one build type from overwriting the logs of another 
build type.&nbsp; Subsequent build runs with the same build type will overwrite 
the previous log file.</span></p>
<p>
<span class="subheadingblack">Build log file names are annotated using the value of the </span>BUILD_ALT_DIR environment variable.&nbsp; The extension 
of the log file will be .log for the complete log output, .err for a build error 
output subset, and .wrn for a build warning output subset.</p>
<h4>
Build Log File Names</h4>

  <table border="1"  width="90%">
    <tr valign="top">
      <th width="17%">Build type</th>
      <th width="14%">BUILD_ALT_DIR env var</th>
      <th width="23%">Full log file name<br>
      (always created)</th>
      <th width="23%">Error log file name<br>
      (only created if build contains errors)</th>
      <th width="48%">Warning log file name<br>
      (only created if build contains warnings)</th>
    </tr>
    <tr>
      <td width="17%">
          checked (default)</td>
      <td width="14%">
          c</td>
      <td width="23%">
          buildc.log</td>
      <td width="23%">
          buildc.err</td>
      <td width="48%">
          buildc.wrn
      </td>
    </tr>
    <tr>
      <td width="17%">
          free</td>
      <td width="14%">[not set]</td>
      <td width="23%">build.log</td>
      <td width="23%">build.err</td>
      <td width="48%">build.wrn </td>
    </tr>
    <tr>
      <td width="17%">
          debug</td>
      <td width="14%">d</td>
      <td width="23%">buildd.log</td>
      <td width="23%">buildd.err</td>
      <td width="48%">buildd.wrn </td>
    </tr>
  </table>

<p>
<span class="subheadingblack">Build log files will be generated at the root 
directory where the build utility finds a dirs file and begins recursively 
building the source tree.&nbsp; When you execute the buildall script or batch 
file several different builds are sequentially performed.&nbsp; </span></p>
<p>
If you explicitly switch to a directory and run build, log files will be 
generated in that directory.&nbsp;For the build utility to work you must be in 
a directory with either a <i>dirs</i> or <i>sources</i> file. </p>
<p>
If you encounter an error during build, you should look for build error log 
files (such as buildc.err) to obtain more information.&nbsp; However, the build 
error log files will often only contain incomplete error output resulting from a 
previous error that did not get sent to the error log file.&nbsp; For example, 
many errors that occur when building managed code using the SSCLI C# compiler 
are not emitted correctly to the error log file.&nbsp; For complete diagnostics 
you should read the full build log file.&nbsp; This will show the initial build 
error that might have cascaded into subsequent output in the build error log 
file.</p>

 
<h2><a name="NotesHintsandTips"></a>Notes, Hints, and Tips</h2>
<h3><a name="AutogeneratedFiles"></a>Autogenerated Files</h3>
<p>Note that some files in the SSCLI source tree are autogenerated before being 
placed in the SSCLI source tree, due to the requirement to interoperate with 
other build environments within Microsoft and the decision not to port some 
internal Microsoft tools to run on top of the SSCLI PAL.&nbsp; For example:</p>
<ul>
  <li>Some .h include files are generated by the Microsoft MIDL compiler from 
  .idl files.&nbsp; Only the  .h files are included in the SSCLI source tree.</li>
  <li>Parseasm.cpp is generated by means of an internal YACC-like tool.&nbsp; 
  Only the resulting output file is included in the SSCLI source tree.</li>
  <li>All  .nlp files are generated by internal Microsoft tools.&nbsp;Only the 
  resulting  .nlp output files are included.</li>
</ul>
<h3><a name="FasterRebuilds"></a>Faster Rebuilds</h3>
<p>If you want to do a quick rebuild after changing a C/C++ file, use: </p>
  <blockquote>build -z</blockquote>

 
<p>The -z option skips recalculations of file dependencies.</p>
  However, if you are changing a C/C++ header file, do not use -z because it will 
not evaluate the dependency between the header file and the source code.
<a name="FilePreprocessing"></a>
    <br />
    <br />
    <i>Copyright (c) 2006 Microsoft Corporation. All rights reserved.</i>
</body> 
</html>